interface ResponseType {
  code: 1 | -1
  data: { token: string }
  msg: string
}

export type LoginParamsType = { username: string; password: string }

export const fetchLogin = ({ username, password }: LoginParamsType) => {
  return new Promise<ResponseType>((resolve, reject) => {
    setTimeout(() => {
      resolve({
        code: 1,
        msg: 'success',
        data: {
          token: `${username}_123_${password}`,
        },
      })
    }, 1000)
  })
}
